const {exec,escape} = require('../db/mysql.js')
const {mdPassword} = require('../utils/cryp')
const login = async (usernamem,password)=>{
   usernamem = escape(usernamem)
   password = escape(mdPassword(password))
  const sql = `select username,realname from users where username=${usernamem} and password=${password} `
  const rows = await exec(sql)
  return  rows[0]
}
module.exports={
  login
}
